ScanScreenState

State used to take pictures from a DocumentScanScreen.

In Compose, create and retain an instance with rememberScanScreenState. To own the state outside composition, construct an instance directly and retain it for the lifetime of the screen, then pass it to DocumentScanScreen, for example inside a ComposeView. Capture operations are available only while the state is attached to a screen and its camera is ready.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun takePicture(): ByteArray

Takes a picture and returns its JPEG bytes.

Link copied to clipboard
suspend fun ScanScreenState.takePicture(outputFile: File)

Takes a picture and writes its JPEG bytes to outputFile.